import request from '@/router/axios';
// 分页
export const getPage = (current, size, params) => {
  return request({
    url: '/api/mes-admin/datasql/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
// 新增
export const addSubmit = (row) => {
  return request({
    url: '/api/mes-admin/datasql/submit',
    method: 'post',
    data: row
  });
};
// 编辑
export const updateSubmit = (row) => {
  return request({
    url: '/api/mes-admin/datasql/submit',
    method: 'post',
    data: row
  });
};
// 删除
export const deleteRemove = (ids) => {
  return request({
    url: '/api/mes-admin/datasql/remove',
    method: 'post',
    params: {
      ids
    }
  });
};
//详情
export const getDetail = (id) => {
  return request({
    url: '/api/mes-admin/datasql/detail',
    method: 'get',
    params: {
      id
    }
  });
};
// 启用 禁用
export const submitBatch = (row) => {
  return request({
    url: '/api/mes-admin/datasql/submitBatch',
    method: 'post',
    data: row
  });
};

//数据字典
export const getShfitType = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=DATA_SQL_TYPE',
    method: 'get',
    params: {}
  });
};
